Fix borrowFromRight: replace silent warn with error log + add linked-list/separator invariant tests#1
Draft
Copilot wants to merge 2 commits into
Draft
Fix borrowFromRight: replace silent warn with error log + add linked-list/separator invariant tests#1Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…rowFromRight test cases Co-authored-by: 4iKZ <145829986+4iKZ@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix update of separator key in borrowFromRight method
Fix borrowFromRight: replace silent warn with error log + add linked-list/separator invariant tests
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
borrowFromRightsilently swallowed a corrupting edge case viaconsole.warn, leaving parent separator keys stale. Three new tests coverborrowFromRight-triggered scenarios that were previously untested.Changes
utils/bPlusTreeLogic.tsborrowFromRightleaf branch: Replaceconsole.warn('Right sibling became empty...')withconsole.error(...)carrying a clear diagnostic message. Theifbranch gains a comment explaining the B+ tree invariant being maintained (parent.keys[childIdx] == rightSibling.min).utils/__tests__/bPlusTreeLogic.test.tsThree new test cases targeting
borrowFromRightscenarios:nextchain intact after borrow — inserts[1..7], deletes1(triggersborrowFromRighton leftmost leaf), traversesnextpointers and asserts all of[2..7]are reachable in order.nextchain integrity — inserts 20 rows, deletes 10 even keys, asserts the leaf linked list contains exactly the 10 odd keys in sorted order.assertSeparatorInvariantsto confirm all parent separator keys satisfy the B+ tree invariant post-borrow.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
registry.npmmirror.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/_temp/ghcca-node/node/bin/npm install(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/_temp/ghcca-node/node/bin/npm install --prefer-offline(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This pull request was created from Copilot chat.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.